import Vue from 'vue'
import VueRouter from 'vue-router'
import Login from '../views/login.vue'
import Layout from '../views/layout.vue'
import My from '../views/my.vue'
import Home from '@/views/home.vue'
import Question from '../views/question.vue'
import Video from '../views/video.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/login',
    component: Login
  },
  {
    path: '/',
    component: Layout,
    children: [
      {
        path: 'home',
        component: Home
      },
      {
        path: 'question',
        component: Question
      },
      {
        path: 'video',
        component: Video
      },
      {
        path: 'my',
        component: My
      }
    ]
  }
]

const router = new VueRouter({
  routes
})

export default router
